package com.teamone.etl.util;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description 转List工具类
 * @Author WangZhuoRan
 * @Date 2021-01-14 09:23
 */
public class ListUtil {
    public static <T> List<T> castList(Object obj, Class<T> clazz) {
        List<T> result = null;
        if(obj instanceof List<?>) {
            result = new ArrayList<>();
            for (Object o : (List<?>) obj) {
                result.add(clazz.cast(o));
            }
        }
        return result;
    }
}
